with ($ns("fp.views"))
{
    fp.views.BaseFeedView = function($p_container, p_options)
    {
        var me = new mx.controls.JQControl($p_container, p_options);
        var base = {};
        
        me.viewType = null;
        me.feeds = [];
        me.pageCount = 20;
                
        me.onloadingrequired = null;
        me.onmaskshowing = null;
        me.onmaskhiding = null;
        
        base.init = me.init;
        me.init = function()
        {           
            base.init();
        };
        
        
        
        me.activate = function()
        {
            
        };
        
        me.deactivate = function()
        {
            
        };
        

        
        me.moveFirst = function()
        {
            me.$container.stop(true, true);
            me.$container.animate({
                scrollTop: 0
            }, "normal");
        };
        
        me.moveNext = function()
        {
            
        };
        
        me.movePrevous = function()
        {
            
        };
        
        
        
        me.openInNewTab = function()
        {
            
        };
        
        me.toggleStar = function()
        {
            
        };
        
        
        me.appendFeed = function(p_feed)
        {
            me.feeds.add(p_feed);
            me.renderFeed(p_feed);
        };
        
        me.appendFeeds = function(p_feeds)
        {
            for (var i = 0; i < p_feeds.length; i++)
            {
                var feed = p_feeds[i];
                me.appendFeed(feed);
            }
        }
        
        me.clearFeeds = function()
        {
            me.feeds.clear();
        };
        
        
        
        
        me.saveCapture = function()
        {
            chrome.tabs.captureVisibleTab(null, { format:'png' }, function(p_dataUrl) {
                var bufferImg = document.createElement('img');
                bufferImg.src = p_dataUrl;
                bufferImg.onload = function()
                {
                    var canvas = document.createElement('canvas');
                    canvas.width = me.$container.width();
                    canvas.height = me.$container.height();
                    var context = canvas.getContext('2d');
                    var pos = me.$container.absolutePosition();
                    context.drawImage(bufferImg, 0, -pos.top);                    
                    var dataUrl = canvas.toDataURL('image/jpeg');
                    localStorage["screencapture." + me.viewType] = dataUrl;
                }
            });
        };
        
        me.getCapture = function()
        {
            return localStorage["screencapture." + me.viewType];
        }
        
        
        
        me.renderFeed = null;
        
        
        
        
        
        return me;
    }
}